﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="GoodStocktaking.ascx.cs" Inherits="Controls_Activity_GoodStocktaking" %>
<%@ Register Src="SelectGood.ascx" TagName="GoodItemSelect" TagPrefix="uc1" %>
 <asp:Panel ID="pnlItemsGrid" runat="server" CssClass="centerPanel" Width="100%">
      <div class="webPanelBorder" >
        <div class="webPanelCaption">盘点单信息</div>
        <div class="webPanelContent">
             <table cellspacing="1" class="table">
                <tr>
                    <td class="tableSubjectWidth">盘点日期：
                    </td>
                    <td><asp:TextBox ID="P_StocktakingDate" onfocus="calendar.ShowCaltable(this, event);" runat="server" CssClass="shortInput" MaxLength="64" ></asp:TextBox>
                    <ofcc:RequiredField ID="RequiredField1" runat="server" />
                    </td>
                    <td>备    注：</td>
                    <td><asp:TextBox ID="P_Description" runat="server" CssClass="shortInput" MaxLength="64"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>经 办 人：</td>
                    <td><asp:TextBox ReadOnly="true" ID="P_LoginName" runat="server" CssClass="shortInput" MaxLength="64"></asp:TextBox>
                    </td>
                    <td>经办部门：</td>
                    <td><asp:TextBox ReadOnly="true" ID="P_Department" runat="server" CssClass="shortInput" MaxLength="64"></asp:TextBox>
                    </td>
                </tr>  
                </table>      
        </div>  
    </div>
 
    <div class="webPanelBorder" >
        <div class="webPanelCaption">具体物料项</div>
        <div class="webPanelContent">
        <asp:UpdatePanel runat="server" ID="UpdatePanel2">
            <ContentTemplate> 
          <ofcc:GridView ID="gridViewItems" runat="server" AutoGenerateColumns="False" 
            OnRowDataBound="gridViewItems_RowDataBound" onrowdeleting="gridViewItems_RowDeleting" OnRowEditing="gridViewItems_RowEditing" 
            >
                <Columns>
            <asp:HyperLinkField DataTextField="GoodsCode" HeaderText="物料编号" NavigateUrl="#" Target="_blank" />
                    <asp:BoundField DataField="Subject" HeaderText="物料名称" />
                    <asp:BoundField DataField="CategoryName" HeaderText="物料类型" />
                    <asp:BoundField DataField="GoodsMaker" HeaderText="品牌厂商" />
                    <asp:BoundField DataField="TypeModel" HeaderText="规格型号" />
                    <asp:BoundField DataField="GoodsUnit" HeaderText="单位" />
                    <asp:BoundField DataField="ActiveCount" HeaderText="可用数量" />
                    <asp:BoundField DataField="OldCount" HeaderText="旧料回收数量" />
                    <asp:BoundField DataField="BadCount" HeaderText="报废数量" />
                    <asp:TemplateField HeaderText="实际可用数量">
                        <ItemTemplate>
                            <asp:HiddenField ID ="GoodsID" runat="server" Value='<%#Eval("GoodsID") %>' />
                            <asp:TextBox ID="ActiveRealCount" runat="server" CssClass="smallInput" Width="80" value='<%#DataBinder.Eval(Container.DataItem,"ActiveRealCount")%>' name="RealCount" type="text" ></asp:TextBox> 
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="旧料回收数量">
                        <ItemTemplate>
                            <asp:TextBox ID="OldRealCount" runat="server" CssClass="smallInput" Width="80" value='<%#DataBinder.Eval(Container.DataItem,"OldRealCount")%>' name="LossCount" type="text" ></asp:TextBox> 
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="报废数量">
                        <ItemTemplate>
                            <asp:TextBox ID="BadRealCount" runat="server" CssClass="smallInput" Width="80" value='<%#DataBinder.Eval(Container.DataItem,"BadRealCount")%>' name="LossCount" type="text" ></asp:TextBox> 
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="备注">
                        <ItemTemplate>
                            <asp:TextBox ID="Description" runat="server" CssClass="smallInput" Width="100" value='<%#DataBinder.Eval(Container.DataItem,"Description")%>' name="Description" type="text" ></asp:TextBox> 
                        </ItemTemplate> 
                    </asp:TemplateField>
                <asp:BoundField DataField="IsCheck" HeaderText="状态" />  
                <asp:CommandField ShowEditButton="true" EditText="确认"/>
                <asp:CommandField ShowDeleteButton="true" DeleteText="删除" />
                </Columns>
            </ofcc:GridView>
                 <asp:Panel ID="pnlSearchGoodCode" runat="server" Visible=false>
                    <span style="float:left">物料编号:&nbsp;<ofcc:ToolTip CssClass="tip" ToolTip="扫描或者输入编号后按回车"  ID="ToolTip2" runat="server" />
                    &nbsp;&nbsp;<asp:TextBox ID="tbGoodCode" runat="server" CssClass="smallInput"></asp:TextBox></span>
                 </asp:Panel>
            </ContentTemplate>
        </asp:UpdatePanel>
        </div>     
    </div> 
     <uc1:GoodItemSelect ID="GoodItemSelect" runat="server" />  
     <div class="webPanelButtonArea">
        <ofcc:LinkButton ID="btnSearchGoodCode" runat="server" OnClick="btnSearchGoodCode_Click" CssClass="linkButton" >扫描物料</ofcc:LinkButton>
        <ofcc:LinkButton ID="btnSelect" runat="server" OnClick="btnSelect_Click" CssClass="linkButton" ValidationGroup="select">选择</ofcc:LinkButton> 
        <ofcc:LinkButton ID="btnSubmit" runat="server" ConfirmMessage="保存盘点单当前库存信息即时生效，是否确定保存盘点单？" OnClick="btnSubmit_Click" CssClass="linkButton" ValidationGroup="submit">完成盘点</ofcc:LinkButton>
        <ofcc:LinkButton ID="btnCancel" runat="server" OnClick="btnCancel_Click"  CssClass="linkButton">取消</ofcc:LinkButton>
    </div>
    <asp:HiddenField ID="hfAddOrEdit" runat="server" />
    <asp:HiddenField ID="hfStocktakingID" runat="server" />
    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="P_StocktakingDate"
    Display="None" ErrorMessage="请选择盘点日期" ValidationGroup="submit"></asp:RequiredFieldValidator>
 
    <asp:ValidationSummary ID="ValidationSummary1" runat="server" EnableViewState="False"
     ShowMessageBox="True" ShowSummary="False" ValidationGroup="submit" />
    
 </asp:Panel> 